Add refreshMaterializedView command#332
Open
Gerych1984 wants to merge 1 commit intoyiisoft:masterfrom
Open
Conversation
aaff285 to
08b86eb
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #332 +/- ##
=============================================
- Coverage 100.00% 99.85% -0.15%
- Complexity 241 252 +11
=============================================
Files 16 16
Lines 694 714 +20
=============================================
+ Hits 694 713 +19
- Misses 0 1 +1 ☔ View full report in Codecov by Sentry. |
08b86eb to
5a3d4e9
Compare
5a3d4e9 to
f07182c
Compare
vjik
reviewed
Jan 20, 2024
| } | ||
|
|
||
| /** | ||
| * @see {https://www.postgresql.org/docs/current/sql-refreshmaterializedview.html} |
Member
There was a problem hiding this comment.
Suggested change
| * @see {https://www.postgresql.org/docs/current/sql-refreshmaterializedview.html} | |
| * @see https://www.postgresql.org/docs/current/sql-refreshmaterializedview.html |
| $tableSchema = $this->db->getTableSchema($viewName); | ||
|
|
||
| if ($tableSchema) { | ||
| $hasUnique = count($this->db->getSchema()->findUniqueIndexes($tableSchema)) > 0; |
Member
There was a problem hiding this comment.
Suggested change
| $hasUnique = count($this->db->getSchema()->findUniqueIndexes($tableSchema)) > 0; | |
| $hasUnique = !empty($this->db->getSchema()->findUniqueIndexes($tableSchema)); |
| */ | ||
| public function refreshMaterializedView(string $viewName, ?bool $concurrently = null, ?bool $withData = null): bool | ||
| { | ||
| if ($concurrently || ($concurrently === null || $withData === null)) { |
Member
There was a problem hiding this comment.
Suggested change
| if ($concurrently || ($concurrently === null || $withData === null)) { | |
| if ($concurrently !== false) { |
| ); | ||
| } | ||
|
|
||
| if ($concurrently && !$hasUnique) { |
Member
There was a problem hiding this comment.
Suggested change
| if ($concurrently && !$hasUnique) { | |
| if ($concurrently === true && !$hasUnique) { |
Tigrov
requested changes
Jan 22, 2024
Contributor
Author
I create this PR and i think they must be merged first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new command to refresh PgSql materialized views. I think it can be added in
CommandInterface